package com.livepan.server.dao;

import com.livepan.server.dataobject.ProblemDO;
import com.livepan.server.dataobject.ProblemDOKey;
import com.livepan.server.dataobject.ProblemDOWithBLOBs;

import java.util.List;

public interface ProblemDOMapper {
    int deleteByPrimaryKey(ProblemDOKey key);

    int insert(ProblemDOWithBLOBs record);

    int insertSelective(ProblemDOWithBLOBs record);

    ProblemDOWithBLOBs selectByPrimaryKey(ProblemDOKey key);

    int updateByPrimaryKeySelective(ProblemDOWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(ProblemDOWithBLOBs record);

    int updateByPrimaryKey(ProblemDO record);


    //查询包含关键字的题目的个数
    Integer queryProblemCount(String keyword, Integer contestId);

    List<ProblemDOWithBLOBs> queryProblemList(String keyword,Integer contestId,
                                   int offset, int limit);

    Integer addSubmissionCount(Integer problemId, Integer contestId, Integer value);

    Integer addAcceptedCount(Integer problemId, Integer contestId, Integer value);

    List<ProblemDO> getProblemListByContestId(Integer contestId);
}
